package com.xiaodimall.beforesys.controller;

import com.sun.org.apache.regexp.internal.RE;
import com.xiaodimall.beforesys.service.IndexMsgService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author wyc
 * @description
 * @ClassName PageController
 * @date 2022/11/23 19:39
 */
@Controller
public class PageController {

    //注入业务层接口
    @Resource
    IndexMsgService indexMsgService;


    @RequestMapping(value="/")
    public String index(){
        return "mall/index";
    }
    /**
     * 前台
     * 跳转到前台首页
     * @author WYC
     * @param
     * @return: index.html
     * @date: 2022/11/24 11:02
     */
    @ApiOperation(value = "跳转到前台首页")
    @GetMapping("/index")
    public String toIndex(HttpServletRequest session){
         return indexMsgService.getIndexMsg(session);
    }

    /**
     * 前台
     * 跳转前台登录页面
     * @author WYC
     * @param
     * @return: login.html
     * @date: 2022/11/24 11:02
     */
    @ApiOperation(value = "跳转到前台登录页面")
    @GetMapping("/login")
    public String toLogin(){
        return "mall/login";
    }


    /**
     * 前台
     * 跳转前台注册页面
     * @author WYC
     * @param
     * @return: register.html
     * @date: 2022/11/24 11:03
     */
    @ApiOperation(value = "跳转到前台注册页面")
    @GetMapping("/register")
    public String toRegister(){
        return "mall/register";
    }



    @ApiOperation(value = "微信联系方式")
    @GetMapping("/toWeChat")
    public String toWeChat(){
        return "mall/WeChat";
    }


}
